<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
  <title>项目管理</title>
  <jsp:include page="../head.jsp"/>
</head>
<body>
<div class="topbar" id="tb">
  <%--<shiro:hasPermission name="/menu/list">--%>
  <div  class="sys_button" id="refresh"><span class="sys_icon sys_icon_refresh">&nbsp;</span>重新加载</div>
  <%--</shiro:hasPermission>--%>
  <%--<shiro:hasPermission name="/menu/add">--%>
  <div  class="sys_button" id="newUser"><span class="sys_icon sys_icon_add">&nbsp;</span>上传项目</div>
  <%--</shiro:hasPermission>--%>
  <%--<shiro:hasPermission name="/menu/delete">--%>
  <div  class="sys_button" id="deleteUser"><span class="sys_icon sys_icon_delete">&nbsp;</span>下载项目</div>
  <%--</shiro:hasPermission>--%>
  <%--<shiro:hasPermission name="/menu/update">--%>
  <div  class="sys_button" id="modifyUser"><span class="sys_icon sys_icon_modify">&nbsp;</span>删除项目</div>
  <%--</shiro:hasPermission>--%>
</div>
<form id= "uploadForm" >
  <p >指定文件名： <input type="text" name="name" /></p >
  <p >上传文件： <input type="file" name="fileItem"/></p>
  <input type="button" value="上传" onclick="doUpload()"/>
</form>
<%--<table id="dataProjectList" ></table>--%>
</body>
<jsp:include page="../footer.jsp"/>

<script type="text/javascript">
  function doUpload() {
    var formData = new FormData($("#uploadForm")[0]);
    console.log(formData);
    $.ajax({
      url: '/fileManager/uploadFile',
      type: 'POST',
      data: formData,
      async: false,
      cache: false,
      contentType: false,
      processData: false,
      success: function (returndata) {
        console.log(returndata)
      },
      error: function (returndata) {
        console.log(returndata)
      }
    });
  }
</script>

</html>
